<?php
/**
 * XmlRpc Client side
 *
 */
class RpcController extends Zend_Controller_Action 
{
    public function indexAction() 
    {
        /**
         * Important ! we must load Zend_XmlRpc_Client before we use it ! 
         * Even if we already registerAutoload
         *
         */
        Zend_Loader::loadClass('Zend_XmlRpc_Client');

        $filterInt = new Zend_Filter_Int;
        $filterStripTags = new Zend_Filter_StripTags;

        $id = $filterInt->filter('700int');
        $publish = true;

        $structData = array(
            'title' => $filterStripTags->filter('title 007 test'),
            'dateCreated' => new Zend_XmlRpc_Value_DateTime(time(), Zend_XmlRpc_Value::XMLRPC_TYPE_DATETIME),
            'description' => $filterStripTags->filter('This is the content of the body .'),
        );

        $xmlRpcServer = $this->view->host . '/xmlrpc/';
        $client = new Zend_XmlRpc_Client($xmlRpcServer);
        $response = $client->call( 'CALL.callFunc', array((int)$id, (bool)$publish, (array)$structData) );
        echo $response;
        exit();
    }

}